from db.news_dao import NewsDao


class NewService:
    __news_dao = NewsDao()

    # 查询待审批新闻列表
    def approval_news_list(self, page):
        return self.__news_dao.pending_news_list(page)

    # 查询待审批新闻的总页数
    def pending_news_count_page(self):
        return self.__news_dao.pending_news_count_page()

    # 审批新闻
    def approval_news(self, news_id):
        self.__news_dao.approval_news(news_id)

    # 查询新闻列表
    def query_news_list(self, page):
        return self.__news_dao.query_news_list(page)

    # 查询新闻总页数
    def query_total_number_news(self):
        return self.__news_dao.query_total_number_news()

    # 删除新闻
    def delete_new_byid(self, news_id):
        self.__news_dao.delete_new_byid(news_id)